package com.ydx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ydx.entity.User;
import com.ydx.service.UserService;
import com.ydx.mapper.UserMapper;
import org.springframework.stereotype.Service;

/**
* @author zero
* @description 针对表【user】的数据库操作Service实现
* @createDate 2024-06-18 15:51:28
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{
    @Override
    public User checkUserCredentials(String username, int userpassword) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username).eq("userpassword", userpassword);
        // 调用 MyBatis Plus 的方法来查询用户
        User user = getOne(queryWrapper);
        return user;
    }
}




